﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class MessageBox : MonoBehaviour
{

    private Text text;

    void Start()
    {
        text = transform.GetComponent<Text>();
    }

    public void info(string msg)
    {
        text.color = new Color(0, 255, 0);
        text.text = msg;
    }

    public void error(string msg)
    {
        text.color = new Color(255, 0, 0);
        text.text = msg;
    }

    public void clear()
    {
        if (text.text != "")
        {
            text.text = "";
        }
    }
}
